Optimal. Leaf size=144 \[ \frac {x}{b^3}-\frac {a \left (2 a^4-5 a^2 b^2+6 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^3 \left (a^2-b^2\right )^{5/2}}+\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {2871, 3100,
2814, 2739, 632, 210} \begin {gather*} \frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {a^2 \sin (x) \cos (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {a \left (2 a^4-5 a^2 b^2+6 b^4\right ) \text {ArcTan}\left (\frac {a \tan \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{b^3 \left (a^2-b^2\right )^{5/2}}+\frac {x}{b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rule 2871
Rule 3100
Rubi steps
\begin {align*} \int \frac {\sin ^3(x)}{(a+b \sin (x))^3} \, dx &=\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}-\frac {\int \frac {a^2-2 a b \sin (x)-2 \left (a^2-b^2\right ) \sin ^2(x)}{(a+b \sin (x))^2} \, dx}{2 b \left (a^2-b^2\right )}\\ &=\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\int \frac {a b \left (a^2-4 b^2\right )+2 \left (a^2-b^2\right )^2 \sin (x)}{a+b \sin (x)} \, dx}{2 b^2 \left (a^2-b^2\right )^2}\\ &=\frac {x}{b^3}+\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\left (a \left (2 a^4-5 a^2 b^2+6 b^4\right )\right ) \int \frac {1}{a+b \sin (x)} \, dx}{2 b^3 \left (a^2-b^2\right )^2}\\ &=\frac {x}{b^3}+\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}-\frac {\left (a \left (2 a^4-5 a^2 b^2+6 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^3 \left (a^2-b^2\right )^2}\\ &=\frac {x}{b^3}+\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}+\frac {\left (2 a \left (2 a^4-5 a^2 b^2+6 b^4\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {x}{2}\right )\right )}{b^3 \left (a^2-b^2\right )^2}\\ &=\frac {x}{b^3}-\frac {a \left (2 a^4-5 a^2 b^2+6 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^3 \left (a^2-b^2\right )^{5/2}}+\frac {a^2 \cos (x) \sin (x)}{2 b \left (a^2-b^2\right ) (a+b \sin (x))^2}+\frac {a^2 \left (2 a^2-5 b^2\right ) \cos (x)}{2 b^2 \left (a^2-b^2\right )^2 (a+b \sin (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 136, normalized size = 0.94 \begin {gather*} \frac {2 x-\frac {2 a \left (2 a^4-5 a^2 b^2+6 b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}-\frac {a^3 b \cos (x)}{(a-b) (a+b) (a+b \sin (x))^2}+\frac {3 a^2 b \left (a^2-2 b^2\right ) \cos (x)}{(a-b)^2 (a+b)^2 (a+b \sin (x))}}{2 b^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.38, size = 269, normalized size = 1.87
method | result | size |
default | \(\frac {2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{b^{3}}-\frac {2 a \left (\frac {-\frac {a \,b^{2} \left (a^{2}-4 b^{2}\right ) \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (2 a^{4}-a^{2} b^{2}-10 b^{4}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {a \,b^{2} \left (7 a^{2}-16 b^{2}\right ) \tan \left (\frac {x}{2}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}-\frac {a^{2} b \left (2 a^{2}-5 b^{2}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right )}}{\left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 b \tan \left (\frac {x}{2}\right )+a \right )^{2}}+\frac {\left (2 a^{4}-5 a^{2} b^{2}+6 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}-b^{2}}}\right )}{b^{3}}\) | \(269\) |
risch | \(\frac {x}{b^{3}}-\frac {i a^{2} \left (-4 i a^{3} b \,{\mathrm e}^{3 i x}+7 i a \,b^{3} {\mathrm e}^{3 i x}+8 i a^{3} b \,{\mathrm e}^{i x}-17 i a \,b^{3} {\mathrm e}^{i x}+6 a^{4} {\mathrm e}^{2 i x}-9 a^{2} b^{2} {\mathrm e}^{2 i x}-6 b^{4} {\mathrm e}^{2 i x}-3 a^{2} b^{2}+6 b^{4}\right )}{\left (-i b \,{\mathrm e}^{2 i x}+i b +2 a \,{\mathrm e}^{i x}\right )^{2} \left (a^{2}-b^{2}\right )^{2} b^{3}}+\frac {i a^{5} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{3}}-\frac {5 i a^{3} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b}+\frac {3 i a b \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a -a^{2}+b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {i a^{5} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b^{3}}+\frac {5 i a^{3} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} b}-\frac {3 i a b \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {a^{2}-b^{2}}\, a +a^{2}-b^{2}\right )}{\sqrt {a^{2}-b^{2}}\, b}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(606\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 378 vs.
\(2 (134) = 268\).
time = 0.50, size = 819, normalized size = 5.69 \begin {gather*} \left [-\frac {4 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} x \cos \left (x\right )^{2} + {\left (2 \, a^{7} - 3 \, a^{5} b^{2} + a^{3} b^{4} + 6 \, a b^{6} - {\left (2 \, a^{5} b^{2} - 5 \, a^{3} b^{4} + 6 \, a b^{6}\right )} \cos \left (x\right )^{2} + 2 \, {\left (2 \, a^{6} b - 5 \, a^{4} b^{3} + 6 \, a^{2} b^{5}\right )} \sin \left (x\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (x\right ) \sin \left (x\right ) + b \cos \left (x\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - 4 \, {\left (a^{8} - 2 \, a^{6} b^{2} + 2 \, a^{2} b^{6} - b^{8}\right )} x - 2 \, {\left (2 \, a^{7} b - 7 \, a^{5} b^{3} + 5 \, a^{3} b^{5}\right )} \cos \left (x\right ) - 2 \, {\left (4 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} x + 3 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 2 \, a^{2} b^{6}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{4 \, {\left (a^{8} b^{3} - 2 \, a^{6} b^{5} + 2 \, a^{2} b^{9} - b^{11} - {\left (a^{6} b^{5} - 3 \, a^{4} b^{7} + 3 \, a^{2} b^{9} - b^{11}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{7} b^{4} - 3 \, a^{5} b^{6} + 3 \, a^{3} b^{8} - a b^{10}\right )} \sin \left (x\right )\right )}}, -\frac {2 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} x \cos \left (x\right )^{2} - {\left (2 \, a^{7} - 3 \, a^{5} b^{2} + a^{3} b^{4} + 6 \, a b^{6} - {\left (2 \, a^{5} b^{2} - 5 \, a^{3} b^{4} + 6 \, a b^{6}\right )} \cos \left (x\right )^{2} + 2 \, {\left (2 \, a^{6} b - 5 \, a^{4} b^{3} + 6 \, a^{2} b^{5}\right )} \sin \left (x\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (x\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (x\right )}\right ) - 2 \, {\left (a^{8} - 2 \, a^{6} b^{2} + 2 \, a^{2} b^{6} - b^{8}\right )} x - {\left (2 \, a^{7} b - 7 \, a^{5} b^{3} + 5 \, a^{3} b^{5}\right )} \cos \left (x\right ) - {\left (4 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} x + 3 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 2 \, a^{2} b^{6}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{2 \, {\left (a^{8} b^{3} - 2 \, a^{6} b^{5} + 2 \, a^{2} b^{9} - b^{11} - {\left (a^{6} b^{5} - 3 \, a^{4} b^{7} + 3 \, a^{2} b^{9} - b^{11}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{7} b^{4} - 3 \, a^{5} b^{6} + 3 \, a^{3} b^{8} - a b^{10}\right )} \sin \left (x\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 234, normalized size = 1.62 \begin {gather*} -\frac {{\left (2 \, a^{5} - 5 \, a^{3} b^{2} + 6 \, a b^{4}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, x\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{4} b^{3} - 2 \, a^{2} b^{5} + b^{7}\right )} \sqrt {a^{2} - b^{2}}} + \frac {a^{4} b \tan \left (\frac {1}{2} \, x\right )^{3} - 4 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, a^{5} \tan \left (\frac {1}{2} \, x\right )^{2} - a^{3} b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 10 \, a b^{4} \tan \left (\frac {1}{2} \, x\right )^{2} + 7 \, a^{4} b \tan \left (\frac {1}{2} \, x\right ) - 16 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right ) + 2 \, a^{5} - 5 \, a^{3} b^{2}}{{\left (a^{4} b^{2} - 2 \, a^{2} b^{4} + b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, x\right ) + a\right )}^{2}} + \frac {x}{b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.90, size = 2500, normalized size = 17.36 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________